package com.sbio.udiapp.net.exception;

import java.util.function.Consumer;

public class ErrorConsumerAdapterBuilder {
    ErrorConsumerAdapter adapter;

    public static ErrorConsumerAdapterBuilder builder(){
        ErrorConsumerAdapterBuilder errorConsumerAdapterBuilder = new ErrorConsumerAdapterBuilder();
        errorConsumerAdapterBuilder.adapter = new ErrorConsumerAdapter();
        return errorConsumerAdapterBuilder;
    }

    public ErrorConsumerAdapterBuilder before(Consumer<Throwable> consumer) {
        adapter.before = consumer;
        return this;
    }
    public ErrorConsumerAdapterBuilder after(Consumer<Throwable> consumer) {
        adapter.after = consumer;
        return this;
    }

    public ErrorConsumerAdapter build() {
        return adapter;
    }
}
